package com.zjh.shop.fallback;

import com.zjh.shop.client.UserFeignClient;
import com.zjh.shop.dto.DemoInputDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;


@Slf4j
public class UserClientFallBackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable cause) {
        return new UserFeignClient() {
            @Override
            public String hello(DemoInputDTO inputDTO) {
                log.error("hello 调用失败");
                return null;
            }

            @Override
            public String show() {
                log.error("show 调用失败");
                return null;
            }
        };
    }
}
